package cn.fenghua.demoproject2.mapper;

import cn.fenghua.demoproject2.dao.User;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Repository
public class UserMapper {
    private static Map<Integer, User> userMap = new HashMap<>();

    static  {
        userMap.put(1, new User(1, "jack", "123"));
        userMap.put(2, new User(2, "xdclass-lw", "123456"));
        userMap.put(3, new User(3, "tom", "12345678"));
    }

    public List<User> list() {
        List<User> list = new ArrayList<>();
        list.addAll(userMap.values());
        return list;
    }
}
